package org.apache.jsp.common;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.asiainfo.ysrman.doprocess.*;

public final class changePass_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html;charset=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\n");

	String useridStr = session.getAttribute("userid").toString();
    if (useridStr != null)
    {
    	String flag = request.getParameter("flag");
    	if (flag != null && flag.equals("c"))
    	{
			if(request.getMethod().equals("POST"))
			{
				String userpass = request.getParameter("newPass");
				if ( userpass != null )
				{
					int userid = Integer.parseInt(useridStr);
					if ( new YsrProcess().changePass(userid,userpass))
						out.println("<script language=\"javaScript\">alert(\"密码修改成功！\");</script>");
					else
						out.println("<script language=\"javaScript\">alert(\"操作异常，请登录后重新操作！\");</script>");
				}
				else
					out.println("<script language=\"javaScript\">alert(\"密码不能为空！\");</script>");
			}
			else
				out.println("<script language=\"javaScript\">alert(\"操作异常，请登录后重新操作！\");</script>");
    	}
    }
    else
    	out.println("<script language=\"javaScript\">alert(\"请先登录，再修改密码！\");</script>");


      out.write("\n");
      out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">\n");
      out.write("<head>\n");
      out.write("<title>积分</title>\n");
      out.write("\n");
      out.write("<script LANGUAGE=\"JavaScript\" SRC=\"../script/score.js\" type=\"text/javascript\"></script>\n");
      out.write("<link href=\"../styles/styles.css\" rel=\"stylesheet\" type=\"text/css\" />\n");
      out.write("<style type=\"text/css\">\n");
      out.write("<!--\n");
      out.write("body {\n");
      out.write("\tbackground-color:#ffffff;\n");
      out.write("}\n");
      out.write("-->\n");
      out.write("</style></head>\n");
      out.write("\n");
      out.write("<body>\n");
      out.write("<table style=\"margin:10px\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("  <tr>\n");
      out.write("    <td>\n");
      out.write("\n");
      out.write("\t<table class=\"suoyin\" width=\"99%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("      <tr>\n");
      out.write("        <td width=\"18%\">企业服务&gt;&gt;修改密码</td>\n");
      out.write("        <td width=\"82%\"></td>\n");
      out.write("      </tr>\n");
      out.write("    </table>\n");
      out.write("\n");
      out.write("<table class=\"xuanze\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("  <tr>\n");
      out.write("    <td width=\"90%\">\n");
      out.write("\t<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("      <tr>\n");
      out.write("        <td>\n");
      out.write("\n");
      out.write("\n");
      out.write("\t\t</td>\n");
      out.write("      </tr>\n");
      out.write("<tr>\n");
      out.write("        <td>\n");
      out.write("\n");
      out.write("\t\t</td>\n");
      out.write("      </tr>\n");
      out.write("      <tr>\n");
      out.write("        <td>\n");
      out.write("\n");
      out.write("       </td>\n");
      out.write("      </tr>\n");
      out.write("    </table></td>\n");
      out.write("  </tr>\n");
      out.write("</table>\n");
      out.write("\n");
      out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("  <tr>\n");
      out.write("    <td style=\"padding-right:18px\" align=\"right\"></td>\n");
      out.write("  </tr>\n");
      out.write("</table>\n");
      out.write("<form name=\"form1\" method=\"POST\" onsubmit=\"return changePass()\" action=\"changePass.jsp?flag=c\">\n");
      out.write("    <table style=\"border:1px solid #CCCCCC;\" align=\"center\" width=\"80%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("\n");
      out.write("<tr>\n");
      out.write("        <td>\n");
      out.write("\n");
      out.write("          <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("            <tr>\n");
      out.write("              <td class=\"shujutittle\" width=\"100%\" align=\"right\"  colspan=\"2\"><strong><center><font color=\"#ff0000\">");
      out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${requestScope.des}", java.lang.String.class, (PageContext)_jspx_page_context, null, false));
      out.write("</font></center></strong></td>\n");
      out.write("\n");
      out.write("\n");
      out.write("            </tr>\n");
      out.write("        </table></td>\n");
      out.write("      </tr>\n");
      out.write("      <tr>\n");
      out.write("        <td>\n");
      out.write("\n");
      out.write("          <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("            <tr>\n");
      out.write("              <td class=\"shujutittle\" width=\"40%\" align=\"right\"><strong>请输入新密码：</strong></td>\n");
      out.write("              <td class=\"shujutittle\" width=\"60%\" align=\"left\"><strong><input type=\"password\" name=\"newPass\" class=\"btn00\" size=\"30\" /></strong></td>\n");
      out.write("\n");
      out.write("            </tr>\n");
      out.write("        </table></td>\n");
      out.write("      </tr>\n");
      out.write("\n");
      out.write("      <tr>\n");
      out.write("        <td>\n");
      out.write("\n");
      out.write("          <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("            <tr>\n");
      out.write("              <td class=\"shujutittle\" width=\"40%\" align=\"right\"><strong>请确认新密码：</strong></td>\n");
      out.write("              <td class=\"shujutittle\" width=\"60%\" align=\"left\"><strong><input type=\"password\" name=\"confirmPass\" class=\"btn00\" size=\"30\" /></strong></td>\n");
      out.write("\n");
      out.write("            </tr>\n");
      out.write("        </table></td>\n");
      out.write("      </tr>\n");
      out.write("\n");
      out.write("       <tr>\n");
      out.write("        <td>\n");
      out.write("\n");
      out.write("          <table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("            <tr><td class=\"shujutittle\" width=\"100%\" align=\"center\" colspan=\"2\">\n");
      out.write("               <label>\n");
      out.write("             <input type=\"submit\" name=\"Submit\" class=\"btn01\" value=\"确 定\" />\n");
      out.write("             </label></td>\n");
      out.write("            </tr>\n");
      out.write("        </table></td>\n");
      out.write("      </tr>\n");
      out.write("\n");
      out.write("\n");
      out.write("    </table>\n");
      out.write("  </form>\n");
      out.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("  <tr>\n");
      out.write("    <td style=\"padding-right:18px\" align=\"right\"></td>\n");
      out.write("  </tr>\n");
      out.write("</table>\n");
      out.write("\n");
      out.write("\t</td>\n");
      out.write("  </tr>\n");
      out.write("</table>\n");
      out.write("\n");
      out.write("<table width=\"96%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
      out.write("  <tr>\n");
      out.write("    <td align=\"center\"><script language=\"javascript\" type=\"text/javascript\" src=\"../script/bottom.js\"></script></td>\n");
      out.write("  </tr>\n");
      out.write("</table>\n");
      out.write("<!--\n");
      out.write("\t</td>\n");
      out.write("  </tr>\n");
      out.write("</table>-->\n");
      out.write("</body>\n");
      out.write("</html>\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
